﻿<UserControl x:Class="EraDeiFessi.Controls.BookmarkListControl" x:Name="mld1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:myControls="clr-namespace:EraDeiFessi.Controls"
        >
    <Grid Margin="4">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <myControls:LoadingPanel Grid.Row="2" x:Name="lp1" Visibility="Hidden" Panel.ZIndex="9999"/>



        <ItemsControl Margin="2" Grid.Row="2" x:Name="listPlugins" ItemsSource="{Binding ElementName=mld1, Path=Plugins}" Visibility="Visible" HorizontalContentAlignment="Stretch">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel HorizontalAlignment="Stretch">
                        <!--<Button Margin="2" HorizontalAlignment="Stretch" Height="35" Content="{Binding pluginName}" Click="btnPlugin_Click"></Button>-->
                        <GroupBox Header="{Binding pluginName}" Margin="2" HorizontalAlignment="Stretch">
                            <ItemsControl Margin="2" ItemsSource="{Binding AvailableLists}" Visibility="Visible" HorizontalContentAlignment="Stretch">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <UniformGrid Rows="1"/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>

                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Button Margin="2" HorizontalAlignment="Stretch" Height="35" Content="{Binding}" Tag="{Binding}" Click="btnPlugin_Click" />
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </GroupBox>
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>

            <!--<ItemsControl.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}">
                    <Style.Triggers>
                        <Trigger Property="IsSelected"
    					 Value="True">
                            <Setter Property="Background"
    						Value="{x:Null}" />
                            <Setter Property="BorderBrush"
    						Value="{x:Null}" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ItemsControl.ItemContainerStyle>-->
        </ItemsControl>

        <Grid Grid.Row="2" x:Name="gridBookmarks" Visibility="Hidden">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <DockPanel Margin="2" Grid.Row="0">
                <TextBlock Margin="2" Text="Filtro di ricerca" DockPanel.Dock="Left"/>
                <TextBox Margin="2" x:Name="txtFilter" TextChanged="txtFilter_TextChanged"/>
            </DockPanel>

            <ListView Margin="2" Grid.Row="1" x:Name="listShows" ItemsSource="{Binding ElementName=mld1, Path=BookmarksView}" SelectionChanged="listShows_SelectionChanged" >
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid HorizontalAlignment="Stretch">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>

                            <StackPanel Orientation="Vertical" Margin="2">
                                <TextBlock Margin="2" FontWeight="Bold" FontSize="12" Text="{Binding Name}"/>
                                <TextBlock Margin="2" FontWeight="Normal" Foreground="Gray" FontSize="10" Text="{Binding Url}"/>
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

            <StackPanel Margin="2" Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center">
                <Button Margin="2" Width="120" Height="30" x:Name="btnGo" Click="btnGo_Click" HorizontalAlignment="Right" IsEnabled="False">
                    <StackPanel Orientation="Horizontal">
                        <myControls:AutoGreyableImage Source="..\Resources\icon_go.png" Margin="2"/>
                        <TextBlock Margin="2" VerticalAlignment="Center">Apri</TextBlock>
                    </StackPanel>
                </Button>

                <Button Margin="2" Width="120" Height="30" x:Name="btnMore" Click="btnMore_Click" HorizontalAlignment="Right" IsEnabled="False">
                    <StackPanel Orientation="Horizontal">
                        <!--<myControls:AutoGreyableImage Source="..\Resources\icon_back.png" Margin="2"/>-->
                        <TextBlock Margin="2" VerticalAlignment="Center">Carica altri</TextBlock>
                    </StackPanel>
                    
                </Button>
                
                
                
                <Button Margin="2" Width="120" Height="30" x:Name="btnBack" Click="btnBack_Click" HorizontalAlignment="Right">
                    <StackPanel Orientation="Horizontal">
                        <myControls:AutoGreyableImage Source="..\Resources\icon_back.png" Margin="2"/>
                        <TextBlock Margin="2" VerticalAlignment="Center">Indietro</TextBlock>
                    </StackPanel>
                </Button>

                
            </StackPanel>
        </Grid>



    </Grid>
</UserControl>
